package com.zzxy.spring34.po;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.InitializingBean;

public class User implements BeanNameAware, BeanFactoryAware, InitializingBean {
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
        System.out.println("2.set properties...");
    }

    public User() {
        System.out.println("1.init instance...");
    }

    @Override
    public void setBeanName(String s) {
        System.out.println("3. set bean name...");
    }

    @Override
    public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
        System.out.println("4.set bean factory...");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("6.after properties...");
    }

    public void myInit(){
        System.out.println("7. my init...");
    }
}
